<template>
    <!--公司简介-->
    <div class="companyBox">
        <div class="companyMsg" v-for="(item,index) in datas.descList" :key="index">
            <div class="companyTitle"> {{ item.title }}</div>
            <div class="companyContent">{{ item.content }}</div>
            <div v-if="item.title === '领导寄语'">
                <div class="personInfo" v-for="(infoItem,index) in item.list" :key="index">
                    <div class="personCard">
                        <div class="cardSize">
                            {{ infoItem.name }}
                        </div>
                    </div>
                    <div class="personMessage">
                        <div class="infoTop">
                            <span class="name">{{ infoItem.name }}</span>
                            <span class="work">{{ infoItem.position }}</span>
                        </div>
                        <div class="content">{{ infoItem.content }}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
//mock数据真实服务注释删除
import datas from '../../mock/company/company';
import i18n from '../../i18n';
export default {
    data() {
        return {
            datas,
            title:''
        }
    },
    created() {
        window.HWH5.navTitle({ title: `${this.title}` });
        window.HWH5.setNavigationBarTitle({ title: this.$t('companyIntroduce')  });
        // 真实请求服务方法
        // const userId = this.$store.state.userInfo.userId
        // this.getDatas(userId)
    },
    mounted(){
    },
    methods: {
        // 获取服务接口数据
        // getDatas(userId) {
        //   真实接口服务请求 需要将userInfo中的id作为参数传进去做数据请求
        //   const url = 'https://xxx?userId' + userId;
        //   const _headers = {
        //     'Content-Type': 'application/json'
        //   };
        //   HWH5.fetchInternet(url, {
        //     method: 'get',
        //     headers: _headers
        //   })
        //     .then(res => {
        //       res.json().then(reply => {
        //           //将接口返回数据赋值给热服务
        //           this.datas = reply
        //       });
        //     })
        //     .catch(error => {
        //       console.log('请求异常', error);
        //     });
        // }
    }
}

</script>

<style lang="less" scoped>
.companyBox {
    box-sizing: border-box;
    padding: 8px 8px;
    .companyMsg {
        background: #fff;
        width: 100%;
        margin-bottom: 8px;
        box-sizing: border-box;
        padding: 13px 16px;
        .companyTitle {
            font-family: PingFangSC-Regular;
            font-size: 12px;
            color: #999999;
            letter-spacing: 0;
            margin-bottom: 6px;
        }
        .companyContent {
            font-family: PingFangSC-Regular;
            font-size: 14px;
            color: #333333;
            letter-spacing: 0;
        }
        .personInfo {
            height:72px;
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            padding: 11px 0 0 0;
            .personCard {
                width:15%;
                height: 100%;
                margin: 0 auto;
                margin-top: 2%;
                .cardSize {
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    background: #df99fd;
                    font-size: 12px;
                    text-align: center;
                    line-height: 40px;
                    color:#fff
                }
            }
            .personMessage {
                width: 80%;
                height: 100%;
                border-bottom:1px solid #e8e8e8;
                .infoTop {
                    margin-bottom:6px;
                    .name {
                        font-family: PingFangSC-Regular;
                        font-size: 16px;
                        color: #333333;
                        letter-spacing: 0;
                        margin-right: 16px;
                    }
                    .work {
                        font-family: PingFangSC-Regular;
                        font-size: 16px;
                        color: #999999;
                        letter-spacing: 0;   
                    }
                }
                .content {
                    font-family: PingFangSC-Regular;
                    font-size: 14px;
                    color: #999999;
                    letter-spacing: 0;
                }
            }
        }
    }
}
</style>